package com.evildog.workspace.life.application.forest;

import com.dtflys.forest.annotation.Request;
import com.evildog.workspace.life.application.bo.DailyWeatherBO;
import com.evildog.workspace.life.application.bo.WeatherBO;

/**
 * 和风天气
 * @link {https://dev.heweather.com/docs/api/weather}
 */
public interface WeatherApi {

    /**
     * 获取地址的当前实时天气
     * @param locationId 地址locationId
     * @param key 开发key
     */
    @Request(url = "https://devapi.heweather.net/v7/weather/now?location=${0}&key=${1}",
            dataType = "json")
    WeatherBO getNowWeather(String locationId, String key);


    /**
     * 获取地址的三天的天气信息
     * @param locationId 地址locationId
     * @param key 开发key
     */
    @Request(url = "https://devapi.heweather.net/v7/weather/3d?location=${0}&key=${1}",
            dataType = "json")
    DailyWeatherBO getTreeDaysWeather(String locationId, String key);

    /**
     * 逐小时预报（未来24小时）
     * @param locationId 地址locationId
     * @param key 开发key
     */
    @Request(url = "https://devapi.heweather.net/v7/weather/24h?location=${0}&key=${1}",
            dataType = "json")
    DailyWeatherBO getHourlyWeatgher(String locationId, String key);

}
